import {
	request
} from "@/utils/request"

// 提交首页页面异常数据接口
export const indexData = (data) => request({
	url: `index/postYcmsg`,
	method: "POST",
	data
})
// 师傅/学徒订单列表接口
export const getOrderList = (params, data) => request({
	url: `order/getWorkerOrderList`,
	method: "GET",
	data,
	params
})

// 获取订单详情
export const getOrderDetail = (id, funtype = "") => request({
	url: `order/getDetails`,
	method: "GET",
	params: {
		id,
		funtype
	}
})

// 接单
export const receivingOrders = (realorder_id) => request({
	url: `order/postReception`,
	method: "POST",
	data: {
		realorder_id
	}
})

// 修改预约时间
export const updateAppointmentTime = (id, time) => request({
	url: `order/postAppointment`,
	method: "POST",
	data: {
		realorder_id: id,
		appointment: time,
		funtype: 1
	}
})

// 详情提交
export const orderDetailSumit = (data) => request({
	url: `order/postSubmitDetails`,
	method: "POST",
	data
})
// 详情提交
export const repairSubmitDetails = (data) => request({
	url: `order/postRepairSubmitDetails`,
	method: "POST",
	data
})

// 完成订单
export const completeOrder = (realorder_id) => request({
	url: `order/postComplete`,
	method: "POST",
	data: {
		realorder_id
	}
})

// 申请转单
export const applyTransferOrder = (data) => request({
	url: `order/postApplyTransfer`,
	method: "POST",
	data
})

// 发送短信
export const postSmsnotice = (data) => request({
	url: `order/postSmsnotice`,
	method: "POST",
	data
})
// 验证扫码到场
export const verifyScanCode = (data) => request({
	url: `order/postPresentStatus`,
	method: "POST",
	data
})

/**
 * 申请送返修
 * @param 
 */
export const applyRepatriation = (data) => request({
	url: `order/postApplyReturnIstype`,
	method: "POST",
	data
})

// 本人带回
export const applyBringBack = (realorder_id) => request({
	url: `order/postBringBack`,
	method: "POST",
	data: {
		realorder_id
	}
})

// 申请修改
export const applyUpdate = (data) => request({
	url: `order/postApplyUpdate`,
	method: "POST",
	data
})

// order/postApplyRefund
// 申请退款
export const applyRefund = (data) => request({
	url: `order/postApplyRefund`,
	method: "POST",
	data
})

// 申请加班
export const applyOvertime = (data) => request({
	url: `order/postApplyOvertime`,
	method: "POST",
	data
})

// 添加师傅备注
export const addWorkerRemarks = (data) => request({
	url: `order/postWorkerRemarks`,
	method: "POST",
	data
})

// 添加支付
export const addPayment = (data) => request({
	url: `order/postPayment`,
	method: "POST",
	data
})

// 添加修改发票信息
export const invoiceEdit = (data) => request({
	url: `order/postInvoiceEdit`,
	method: "POST",
	data
})

// 师傅设置费用
export const workerSettingCost = (data) => request({
	url: `order/postOrderbranchMoney`,
	method: "POST",
	data
})

// 售后保修贴
export const afterSales = (data) => request({
	url: `order/postGgimg`,
	method: "POST",
	data
})

// 送返修自提点
export const selfPickList = (data) => request({
	url: `order/getPickedList`,
	method: "GET",
	data
})

// 通用表单配置
export const getCommonFormConfig = (realorder_id, funtype = "") => request({
	url: `order/getFormConfig`,
	method: "GET",
	params: {
		realorder_id,
		funtype
	}
})

// 添加报价
export const addQuotation = (data) => request({
	url: `order/postQuote`,
	method: "POST",
	data
})
// 拨打电话
export const makingPhone = (realorder_id) => request({
	url: `order/postCallphone`,
	method: "POST",
	data: {
		realorder_id
	}
})


// 获取历史发票
export const getInvoiceHistory = (realorder_id) => request({
	url: `order/getInvoiceHistory`,
	method: "GET",
	params: {
		realorder_id
	}
})
// 送返修列表
export const getWorkerRepairList = (params) => request({
	url: `order/getWorkerRepairList`,
	method: "GET",
	params
})


// 转待完成
export const transferDewancheng = (realorder_id) => request({
	url: `order/postDewancheng`,
	method: "POST",
	data: {
		realorder_id
	}
})

// 提交好评
export const submitFavorableComment = (data) => request({
	url: `order/postPraise`,
	method: "POST",
	data
})


// 验券
export const postPayReceiptConsume = (data) => request({
	url: `order/postPayReceiptConsume`,
	method: "POST",
	data
})

// 门店类别
export const getMeituanShopType = (data) => request({
	url: `order/getMeituanShopType`,
	method: "GET"
})

// 门店列表
export const getMeituanShopUuid = (cityname) => request({
	url: `order/getMeituanShopUuid`,
	method: "GET",
	params: {
		cityname
	}
})


// 验券记录
export const getMeituanScopereceiptLog = (params) => request({
	url: `order/getMeituanScopereceiptLog`,
	method: "GET",
	params
})

// 订单历史记录
export const getHistorylog = (params) => request({
	url: `order/getHistorylog`,
	method: "GET",
	params
})

// 验券修改
export const editPayReceiptConsume = (realorder_id, receipt_code) => request({
	url: `order/postEditPayReceiptConsume`,
	method: "POST",
	data: {
		realorder_id,
		receipt_code
	}
})

// 订单统计
export const getCountTabs = (funtype) => request({
	url: `order/getCountTabs`,
	method: "GET",
	data: {
		funtype
	}
})

// 签单未付修改
export const postPaymentSignEdit = (data) => request({
	url: `order/postPaymentSignEdit`,
	method: "POST",
	data
})

// 历史订单
export const getHistoryPage = (params) => request({
	url: `order/getHistoryPage`,
	method: "GET",
	params
})

// 历史订单
export const postTakeback = (data) => request({
	url: `order/postTakeback`,
	method: "POST",
	data
})

// 好评提交
export const postOrderPraiseSelect = (data) => request({
	url: `Workerdata/postOrderPraiseSelect`,
	method: "POST",
	data
})
// 好评列表
export const getOrderPraiseSelect = (params) => request({
	url: `Workerdata/getOrderPraiseSelect`,
	method: "GET",
	params
})
// 我的送返单列表
export const getWorkerRealorderSelect = (params) => request({
	url: `Workerdata/getWorkerRealorderSelect`,
	method: "GET",
	params
})
// 我的送返单列表统计
export const orderGetCountFuntype = (params) => request({
	url: `Storehouse/getCountFuntype`,
	method: "GET",
	params
})
// 送返修
export const getWorkerOrderSelect = (params) => request({
	url: `Workerdata/getWorkerOrderSelect`,
	method: "GET",
	params
})
// 获取预约过的时间列表
export const getOrderAppointment = (params) => request({
	url: `Workerdata/getOrderAppointment`,
	method: "GET",
	params
})
// 获取预约过的时间列表
export const backPostBringBack = (data) => request({
	url: `/Order/postBringBack`,
	method: "POST",
	data
})
// 上传广告图
export const sendPostGG = (data) => request({
	url: `Order/postGG`,
	method: "POST",
	data
})
// 服务完成
export const serviceCompleted = (realorder_id) => request({
	url: `order/postMtServiceCompleted`,
	method: "POST",
	data: {
		realorder_id
	}
})
// 绑定券码
export const bindingMtCode = (realorder_id, receipt_code) => request({
	url: `order/postMtBindCode`,
	method: "POST",
	data: {
		realorder_id,
		receipt_code
	}
})